<!--{include header}-->
<script>

	//添加用户组	
	function addone()
	{
		var tot = new Date().getTime();
		var url = 'manage.php?c=sysgroup&a=add&t='+tot;
		floatPage(url, '添加用户组', 430, 240, 'location.href=location.href');
		return false;
	}

	//编辑用户组	
	function editone(id)
	{
		var tot = new Date().getTime();
		var url = 'manage.php?c=sysgroup&a=edit&id='+id+'&t='+tot;
		floatPage(url, '编辑用户组', 430, 240, 'location.href=location.href');
		return false;
	}
	
	//确认删除用户组
	function delone(id)
	{
		verify('你确定要删除该用户组吗？', 'ajaxdelone("'+id+'")');
		return false;
	}
	
	//编辑组权限
	function powerone(id)
	{
		location.href = 'manage.php?c=sysgroup&a=editpower&id='+id+'&t='+new Date().getTime();
        return true;
	}
	
	//AJAX删除用户组
	function ajaxdelone(id)
	{
		$.ajax({
			url: 'manage.php?c=sysgroup&a=del&t='+new Date().getTime(),
			data: 'id='+id,
			type: 'post',
			dataType: 'html',
			success: function(res){
				//alert(res);
				if(res == 1){
					right('操作已成功！', 'location.href=location.href');
					//TINY.box.hide();
					//messageSuccess('操作已成功！');
					//location.href=location.href;
				}else if(res == 0){
					wrong('菜单ID不能为空！');
				}else{
					wrong('系统异常，请联系管理员！');
				}
				return true;
			},
			error: function(){
				wrong('网络异常，请检查网络连接！');
				return false;
			}
		})
	}
	

</script>
	<div class="rightmenu">
		<ul>
            <!--{include menu_right}-->
			<li class="act"><a href="javascript:;" onclick="addone()">添加组</a></li>
		</ul>
	</div>
	<div class="workspace" id="workspace">
	<!--用户组列表START-->
	<table cellspacing="0" cellpadding="0" border="0" class="list_tbl">
		<tr class="list_tit">
			<td width="60" class="first">组ID</td>
            <td width="150">组名</td>
			<td width="80">级别</td>
            <td width="80">权重</td>
			<td>备注</td>
			<td width="120">操作</td>
		</tr>
		<!--{if $res}-->
		<!--{loop $res $index $one}-->
		<tr class="tr_a">
			<td>{$one['id']}</td>
            <td>{$one['name']}</td>
			<td>
			<!--{if $one['level'] == 'DEVE'}-->开发者<!--{/if}-->
			<!--{if $one['level'] == 'ADMIN'}-->管理员<!--{/if}-->
			<!--{if $one['level'] == 'WORK'}-->业务<!--{/if}-->
			</td>
            <td>{$one['weight']}</td>
			<td class="show_tips" tips="{$one['notes']}">{$one['notes']}</td>
			<td>
				<a onclick="javascript:powerone({$one['id']});return false;" href="javascript:;">权限</a> |
				<a onclick="javascript:editone({$one['id']});return false;" href="javascript:;">修改</a> |
				<a onclick="javascript:delone({$one['id']});return false;" href="javascript:;">删除</a>
			</td>
		</tr>
		<!--{/loop}-->
		<!--{else}-->
		<tr class="tr_b">
			<td colspan="6" style="color:red">没有记录可以显示！</td>
		</tr>
		<!--{/if}-->
	</table>
	<!--用户组列表END-->
	</div>
<!--{include footer}-->





